<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet">
    <script type="text/javascript" th:src="@{/js/jquery-3.2.1.min.js}"></script>
    <script th:src="@{/layui/layui.js}" charset="utf-8"></script>
    <style type="text/css">
        .iframe{
            width: 1250px;
            height: 530px;
            position: absolute;
            top: 15%;
            right: 3%;
        }
        .bottom{
            text-align: center;
            width: 100%;
            height: 20px;
            position: absolute;
            bottom: 3%;
        }
        #div{
            height: 300px;
            width: 800px;
            border: 1px red solid;
            /*position: absolute;
            top: 25%;
            left: 30%;*/
        }
        #table{
            width: 600px;
            height: 200px;
            text-align: center;
            border: 1px palegreen solid;
        }
        #table,tr,th,td{
            height: 20px;
            font-size: 16px;
            border: 1px gold solid;
        }

    </style>
    <script type="text/javascript">
        $(function(){
           /* $("#hospitalList").html(""):清空*/
            $("#hospitalList").click(function(){
                $.ajax({
                    url: "/getAllDrug",
                    type: "GET",
                    dataType: "json",
                    success: function(jsonlist){
                        show(jsonlist);
                    },
                    error:function(jsonlist){
                        alert("药品查询失败！");
                    }
                })
            });
        })
        function show(jsonlist){
            var strS =  "<table id='table'>"+"<tr><th>药品名称</th><th>药品编号</th><th>药品价格</th><th>保质期</th><th>药品作用</th><th>药品备注</th></tr>";
            var strM =  "</table>";
            var str = "";
            for (var i = 0; i < jsonlist.length; i++) {
                str += "<tr>"
                    +"<td>" + jsonlist[i].drugName + "</td>"
                    +"<td>" + jsonlist[i].drugNum + "</td>"
                    +"<td>" + jsonlist[i].drugPrice + "</td>"
                    +"<td>" + jsonlist[i].expiration + "</td>"
                    +"<td>" + jsonlist[i].drugDesc + "</td>"
                    +"<td>" + jsonlist[i].drugRemark + "</td>"
                    +"</tr>";
            }
            $("#tab").append(strS+str+strM);
        }
        <!-- 隔行变色 -->
        $(function () {/*用于隔行变色*/
            $("tr:gt(0):odd").css("background-color","#fb80b5");
            $("tr:gt(0):even").css("background-color","#e0fb6e");
        })
        $(function (){
            $(".departments").one(function (){
                $.ajax({
                    url: "/getDepartment",
                    type: "GET",
                    dataType: "json",
                    success: function (depList){
                        show(depList);
                    },
                    error: function (depList){
                        alert("科室查询失败！");
                    }
                })
            });
        })
        function show(depList){
            var str = "";
            for (var i = 0; i < depList.length; i++) {
                str += '<div style="width: 100px ; height: auto">'
                    + '<a href="/dmy/touserbooking?departmentName=#{departmentName}">' + depList[i].departmentName + '</a>'
            }
            $(".departments").append(str)
        }
    </script>
</head>
<body>

<ul class="layui-nav">
    <li class="layui-nav-item layui-this"><a th:href="@{#}">医院管理系统</a></li>
    <li class="layui-nav-item">
        <a th:href="@{javascript:;}">首页</a>
    </li>
    <li class="layui-nav-item">
        <a th:href="@{javascript:;}">医院概况</a>
        <dl class="layui-nav-child">
            <dd><a th:href="@{/lsy/profile}" target="together">医院简介</a></dd>
            <dd><a th:href="@{/lsy/expert}" target="together">医院领导</a></dd>
            <dd><a th:href="@{/lsy/honor}" target="together">医院荣誉</a></dd>
            <dd><a th:href="@{/lsy/culture}" target="together">医院文化</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item">
        <a th:href="@{javascript:;}">学科建设</a>
        <dl class="layui-nav-child">
            <dd><a th:href="@{#}" >特色科室</a></dd>
            <dd class="layui-this"><a th:href="@{#}">名医风采</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item"><a th:href="@{#}">新闻中心</a></li>
    <li class="layui-nav-item">
        <a th:href="@{javascript:;}">健康话题</a>
        <dl class="layui-nav-child">
            <!--<dd><a th:href="@{/getAllReview}" target="together">满意度调查</a></dd>
            <dd class="layui-this"><a th:href="@{/toaddReview}" target="together">添加评论</a></dd>-->
            <dd class="layui-this"><a th:href="@{#}" target="together">添加评论</a></dd>-->
        </dl>
    </li>

    <li class="layui-nav-item"><a id="exit" th:href="@{/logout.do}" onclick="return window.confirm('您确定要退出登陆吗?')">退出登陆</a></li>
</ul>

<fieldset class="layui-elem-field layui-field-title" th:style="'margin-top: 30px'">
    <legend> </legend>
</fieldset>

<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo" th:style="'margin-right: 10px'">
    <li class="layui-nav-item layui-nav-itemed">
        <a th:href="@{javascript:;}">功能详情</a>
        <dl class="layui-nav-child">
            <dd><a class="departments" th:href="@{/dmy/deparName}" target="together">预约挂号</a></dd>
            <dd><a th:href="@{record/torecord(id=${session.userSession.id})}" target="together">诊断报告</a></dd>
            <dd><a th:href="@{/toModifyPateint(id=${session.userSession.id})}" target="together">进入用户修改个人信息页面....</a></dd>
            <!--<dd><a th:href="@{/toAddDoctor}" target="together">进入添加医生页面....</a></dd>-->
            <!--<dd><a th:href="@{#}">缴费服务</a></dd>-->
            <dd><a th:href="@{/todoBooking}" target="together">进入预约挂号功能页....</a></dd>
        </dl>
    </li>0
    <li class="layui-nav-item">
       <a th:href="@{javascript:;}">科室</a>
       <dl class="layui-nav-child">
           <dd><a th:href="@{/dmy/getDepartmentTwo}" target="together">特色科室</a></dd>
           <!--<dd><a th:href="@{/togetDepartmentTwo}" target="together">第二种进入查询科室页面</a></dd>
           <dd><a th:href="@{/togetDepartment}" target="together">进入科室查询页面....</a></dd>
           <dd><a th:href="@{/toaddDepartment}" target="together">添加科室</a></dd>
           <dd><a th:href="@{#}">修改科室</a></dd>
           <dd><a th:href="@{#}">删除科室</a></dd>-->
        </dl>
    </li>

    <li class="layui-nav-item">
        <a th:href="@{javascript:;}">药品管理</a>
        <dl class="layui-nav-child">
            <dd><a th:href="@{buydrug/tobuydrug(id=${session.userSession.id})}" target="together">药品订单</a></dd>
            <!--<dd><a id="hospitalList" href="javascript:void(0)">进入药品查询页面(ajax)</a></dd>-->
            <dd><a th:href="@{/togetAllDrug}" target="together">查询药品(跳转页面)</a></dd>
            <!--<dd><a th:href="@{/toaddDrug}" target="together">添加药品</a></dd>-->
        </dl>
    </li>
    <li class="layui-nav-item">
        <a th:href="@{javascript:;}">医生展示</a>
        <dl class="layui-nav-child">
            <!--<dd><a id="hospitalList" href="javascript:void(0)">进入药品查询页面(ajax)</a></dd>-->
            <dd><a th:href="@{/lsy/scheduling}" target="together">排班管理</a></dd>
        </dl>
    </li>
</ul><br>

<!-- 底部代码 -->
<div class="bottom">
			<span class="layui-breadcrumb" lay-separator="|">
				<span>医院北部地址:</span><a th:href="@{#}">郑州市管城区东大街路85/86号</a>
				<span>邮编:</span><a th:href="@{#}">200080</a>
				<span>公交直达线路:</span><a th:href="@{#}">2号线、053号</a>
				<span>郑卫（中医）</span><a th:href="@{#}">网审[2014]第10010号</a>
			  <a th:href="@{#}">亚太地区</a>
			  <a th:href="@{#}"><cite>沪ICP备07501494号-2</cite></a>
			</span>
</div>

<!-- 内联框架:frameborder="1" scroling="yes" -->
<iframe class="iframe" th:src="@{/lsy/profile}" name="together" frameborder="1" scroling="yes"></iframe>


<script th:inline="none">
    layui.use('element', function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

        //监听导航点击
        element.on('nav(demo)', function(elem){
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>
</body>
</html>